package com.jsj.dao;

import com.jsj.domain.Problem;
import com.jsj.domain.TopClass;
import com.jsj.domain.Topic;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface TopicDao {
    List<Topic> queryByCreator(String creator);
    List<Topic> queryByTitle(String title);
    List<Topic> queryByClass(int classId);

    List<Topic> queryByTeacher(int teacherId);

    List<Topic> queryByClassNow(int classId);

    List<Topic> queryByClassBefore(int classId);

    List<Topic> queryByClassAfter(int classId);

    Topic queryById(int id);

    Integer insert(Topic topic);

    Integer insertTopicProblem(@Param("topicId") int topicId, @Param("problemId") int problemId, @Param("nubmer") int nubmer);

    Integer delete(int id);

    Integer allocateForClass(@Param("classId") int classId, @Param("topicId") int topicId);
    Integer allocateForClass1(TopClass topClass);
    List<String> SelectPushList(@Param("classId") String classId);

    Integer unAssignForClass(@Param("classId") int classId, @Param("topicId") int topicId);

    Integer update(Topic topic);
    Integer queryClassByTopic(int topicId);
    Integer queryByFileName(String fileName);
    Integer checkmyself(Topic topic);
}
